<template>
  <div class="main-box p-4.5">
    <el-button @Click="visible = true">打开 EcoDrawer 组件</el-button>
    <el-button @Click="visible1 = true">打开 EcoDrawerForm 组件</el-button>
    <EcoDrawer v-model="visible" size="30%"> 通过 modelValue 打开的 EcoDrawer 组件 </EcoDrawer>
    <EcoDrawerForm v-model="visible1" :drawer-form-props="ecoDrawerProps" :drawer="drawer"> </EcoDrawerForm>
  </div>
</template>
<script setup lang="ts">
const visible = ref(false)
const visible1 = ref(false)
const itemsProps: EcoForm.Item[] = [
  {
    label: 'Title',
    eTag: 'input',
    prop: 'title',
    props: { clearable: true, placeholder: '请输入 TicketDesc' }
  },
  {
    label: 'EventStarTime',
    prop: 'eventStarTime',
    eTag: 'date-picker',
    props: {
      type: 'datetime',
      clearable: true,
      placeholder: '请输入 StarTime',
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    }
  }
]

const ecoDrawerProps = {
  itemsProps: itemsProps as EcoForm.Item[]
}
const drawer = { title: '测试' }
</script>
